package reflect;

import reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo11 {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("reflect.Person");
        Method method = cls.getMethod("sayHi");

        if(method.isAnnotationPresent(AutoRunMethod.class)){
            AutoRunMethod arm = method.getAnnotation(AutoRunMethod.class);
            int value = arm.time();
            System.out.println(value);
        }else{
            System.out.println(method.getName()+"方法没有被@AutoRunMethod标注");
        }



    }
}
